package com.codefish.test;

import com.codefish.GlobalCounter;

/**
 * 访问者线程
 *
 * @author codefish
 * @version 1.0
 * @date 2022/05/28 下午 08:55
 */
public class Visitor extends Thread {

    public Visitor(String name) {
        super(name);
    }

    @Override
    public void run() {
        GlobalCounter counter = GlobalCounter.getInstance();
        int res = counter.increment();
        System.out.println(getName() + "访问了页面,当前页面访问量为" + res);
    }
}
